#include <stdio.h>
#include <fcntl.h>
#include <sys/time.h>
#include "common.h"

void read_file_test() {
    struct timeval tv; 
    gettimeofday(&tv,NULL); //获取当前时间微妙

    printf("start %d \n", tv.tv_sec);

    uint8 buff[SIZE_MB]; //10kB
    int fd = open("/mnt/nvme10/data/test.bin", O_RDWR |O_CREAT, 00777);   

    if(fd < 0) {
        LOG_ERROR("#ERR: error code %d \n", fd);
    }
    size_t i = 0;
    for (; i < 15 * 100 * SIZE_GB / SIZE_MB; i++)
    {
         write(fd, buff, sizeof(buff));
    }
    close(fd);
    gettimeofday(&tv,NULL); //获取当前时间微妙
    printf("end %d \n", tv.tv_sec);
}


int main(int argc, char const *argv[])
{
    read_file_test();
    return 0;
}


